In the demo to run python on the open science grid (OSG), we generated compressed numpy files that contain our results.
In this notebook, we extract these results and plot them on our data to confirm that our program ran correctly.
In [1]:
import tarfile
fname_base = 'C:/gh/data/example/lfp_set_PsTs/out.29419325.'
Nfiles = 10
for n in range(Nfiles):
fname = fname_base + str(n) + '.tar.gz'
tar = tarfile.open(fname, "r:gz")
tar.extractall('C:/gh/data/example/lfp_set_PsTs/' + str(n) + '/')
tar.close()
In [2]:
import numpy as np
Ps = np.zeros(Nfiles, dtype=np.ndarray)
Ts = np.zeros(Nfiles, dtype=np.ndarray)
for n in range(Nfiles):
Ps[n] = np.load('C:/gh/data/example/lfp_set_PsTs/' + str(n) + '/out/Ps_data.npy')
Ts[n] = np.load('C:/gh/data/example/lfp_set_PsTs/' + str(n) + '/out/Ts_data.npy')
In [3]:
lfps = np.zeros(Nfiles, dtype=np.ndarray)
for n in range(Nfiles):
if n == 0:
lfps[n] = np.load('C:/gh/data/example/lfp_set/' + str(10) + '.npy')
else:
lfps[n] = np.load('C:/gh/data/example/lfp_set/' + str(n) + '.npy')
In [4]:
import matplotlib.pyplot as plt
%matplotlib inline
plt.figure(figsize=(10,10))
for n in range(Nfiles):
plt.subplot(Nfiles, 1, n+1)
plt.plot(lfps[n], 'k')
plt.plot(Ps[n], lfps[n][Ps[n]], 'bo')
plt.plot(Ts[n], lfps[n][Ts[n]], 'ro')
if n == Nfiles-1:
plt.xlabel('Time (ms)')
else:
plt.xticks([])
plt.ylim((-3000,3000))
plt.yticks([-3000,0,3000])
if n == 0:
plt.ylabel('Voltage (uV)')
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]:
Out[4]: